package com.itxx.thread2;

import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;

public class ThreadDemo implements Callable<String> {

    @Override
    public String call() throws Exception {
        return null;
    }
}
class Test{
    public static void main(String[] args) {
        //匿名对象创建
         Thread t1 = new Thread(new FutureTask<>(new ThreadDemo()), "线程一");
        //一般
        ThreadDemo t = new ThreadDemo();
        FutureTask<String> ft = new FutureTask<>(t);
        Thread t2 = new Thread(ft, "线程二");

    }
}
